#include "SDLAudialObject.h"

SDLAudialObject::SDLAudialObject(std::string filename)
{
    chunk = Mix_LoadWAV(filename.c_str());
}

SDLAudialObject::~SDLAudialObject()
{
    if(chunk)
    {
        Mix_FreeChunk(chunk);
        chunk = 0;
    }
}

void SDLAudialObject::play()
{
    if(chunk)
        Mix_PlayChannel(-1, chunk, 0);
}
